<html>
<head>
  		<script type="text/javascript" src="/upload/LoadVars.js"><!--// http://www.devpro.it/javascript_id_92.html //--></script>
		<script type="text/javascript" src="/upload/BytesUploaded.js"><!--// http://www.devpro.it/javascript_id_96.html //--></script>
		<script type="text/javascript">
			var bUploaded = new BytesUploaded('/upload/whileuploading.php');
		</script>
</head>
<body>
    <div align="left" class="blank">
        <span class="text_large">
            <img border="0" align="absmiddle" class="home" src="http://cdn.v2ex.com/img/icons/tango/32x32/actions/go-up.png" />Upload
            Portrait</span><hr size="1" color="#eeeeee" style="border: 0pt none; color: rgb(238, 238, 238);
                background-color: rgb(238, 238, 238); height: 1px;" />
        <table cellspacing="0" cellpadding="5" border="0" class="form">
		<form enctype="multipart/form-data" method="post" action="picupload.php" onsubmit="bUploaded.start('fileprogress');">
			<div>
				<fieldset style="padding: 20px;">
					<legend>Add a file</legend>
					<input id="filename" type="file" name="gfile" />
					<input type="submit" value="upload" />					
				</fieldset>
			</div>
		</form>
		
		<div id="fileprogress" style="font-weight: bold;"> </div>
		<pre><!--?php var_dump($_FILES); ?--></pre>


        </table>
        <hr size="1" color="#dddddd" style="border: 0pt none; color: rgb(221, 221, 221);
            background-color: rgb(221, 221, 221); height: 1px;" />
        <img align="absmiddle" src="/img/icons/silk/information.png" />
        For better effect please choose a picture that is larger than 100x100 pixels, JPG/GIF/PNG
        formats are supported</div>
        
</body>
</html>
<?php



$uploaddir = '/home/content/m/i/k/mikewolf/html/upload/';
$jgfilename = (rand()%999999) .  basename($_FILES['gfile']['name']);
$uploadfile = $uploaddir . $jgfilename;

require_once("../class/class.member.setmember.php");
echo $_FILES['gfile']['name'];
if($_FILES['gfile']['name']!="")
{
                $mb = new Member();	
	              $mb->ID = "1";	
	              $mb->imgname = $jgfilename . '';
                SetMember($mb,2);	
}
//echo $uploadfile;
if (move_uploaded_file($_FILES['gfile']['tmp_name'], $uploadfile)) {
        echo  $_FILES['userfile']['tmp_name'] .  "\n";
//    echo "File is valid, and was successfully uploaded.\n";
} else {
//       echo "_file:" . $_FILES['userfile']['tmp_name'] .  "\n";
//echo "#uploadfile:" . $uploadfile . "\n";
//    echo "Possible file upload attack!\n";
}


print_r("\n");
//print_r($_FILES);

?>
